<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <title>Title</title>
</head>


<body>
<script>
  let s = new Set(["a", "b", "c"])

  // s.add(1).add(2)  // 不会重复添加相同项

  // console.log(`返回Boolean,删除是否成功 ${s.delete("a")}`) //返回是否删除成功
  // console.log(`返回Boolean,set是否存在 ${s.has("b")}`)
  // 清空set

  // let keys = s.keys()
  // console.log(keys)
  // console.log(keys.next()) // done == false 表示还没有结束
  // console.log(keys.next())
  // console.log(keys.next())
  // console.log(keys.next())

  // let values = s.values()  // 同上
  // console.log(values.next())
  // console.log(values.next())
  // console.log(values.next())
  // console.log(values.next())

  // let entries = s.entries()  // value: key and index
  // console.log(entries.next())
  // console.log(entries.next())
  // console.log(entries.next())
  // console.log(entries.next())

  // s.clear()
  // console.log(s)
  // let arr = [1, 2, 3, 2, 3, 1, '1', NaN]
  // let a = new Set(arr)
  // console.log(a)
</script>
</body>
</html>